#! /bin/bash

n=1; while :; do
       msga="msg.a.$n"
       msgb="msg.b.$n"
       key="key.$n"
       out="out.$n"
       head -c $n </dev/urandom >$msga
       ./tp1 -l 4 -i $msga -o $out
       ./tp1 -b -i $out -o $msgb
       if diff $msga $msgb; then :; else
               echo ERROR: ver $msga, $msgb, $key, $out.
               break;
       fi
       echo Ok: $n;
       rm -f "$msga" "$msgb" "$key" "$out"
       n="`expr $n + 1`";
done
